FreeImage_LoadImage
ThisImage = FreeImage_LoadImage(Filename$, [ImageFormat=1])
 
Parameters:

    Filename$ = The name and path of the file to load
    [ImageFormat=1] = optional Format param so you can select what format the image is set up in (1=Video,2=FX,8=AFX)
Returns:

    ThisImage = The Index of the newly created/loaded image
 

      The FreeImage_LoadImage function uses the FreeImage library to load one of numerous image formats and prepare it for use as a PlayBASIC image.

      The ImageFormat parameter works the same as the format parameter found in the standard commands such as LoadImage, LoadNewImage, where it dictates the format of the returned image. For more information about the formats read the LoadImage page.




FACTS:


      * The FreeImage library is designed to load a good cross section of the image formats, so it can be very handy for programs where you want to user to load images that may or may not be supported by PB's internal image loading library. The only down side is that the FreeImage.DLL is quite large.




Mini Tutorial:


      This example includes the library, locates an image file that's should be found in the Help files (but might not) and then loads and displays it to the screen.


  
  
; include the Free Image library
  #Include "FreeImage"
  
; Try and locate a image from the help files
  path$=ProgramDir$()+"\Help\Commands/Media/Animations\Star\"
  
; Get the location of the star animation from in the help files
  Filename$=Path$+"star0001.bmp"
  
  
  If FileExist(Filename$)
     
   ; Load the image into memory using FreeImage.
     ThisImage=FreeImage_LoadImage(Filename$)
     
   ; draw this new image image to the screen
     DrawImage ThisImage,0,0,false
     
  Else
     
     Print "Couldn't find file:"
     Print Filename$
     
  EndIf
  
  
; Display the Screen and wait for the user to press a key
  Sync
  WaitKey
  
  




 
Related Info: FreeImage_SaveBMP | FreeImage_SaveJPG | FreeImage_SavePNG | LoadImage :
 


(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com